home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 January: Mac OS SDK / Dev.CD Jan 00 SDK2.toast / Development Kits / • Obsolete⁄Unsupported / ScriptX / Code Samples / autofind / source / database.sx < prev    next >
Encoding:
Text File  |  1996-05-21  |  1.1 KB  |  49 lines  |  [TEXT/ttxt]

  1. --<<<
  2. -- Filename: 
  3. --            database.sx
  4. -- Other Files Required: 
  5. --             adObject.sx
  6. -- Purpose: 
  7. --            Definition and methods for the database
  8. -- Specialized Classes:
  9. --            AdDataBase: indexable collection of adDataObjects, 
  10. --                             from which ads will be selected, based on model, year, and/or price,
  11. --                             and then posted to the Classified Ads.
  12. -- Author:
  13. --            Steve Gano/Dionn Stewart
  14.  
  15. in module Autofinder
  16.  
  17. if (NOT isDefined AdDataObject) do filein theScriptDir name:"adobject.sx"
  18.  
  19. class AdDataBase (ArrayList)
  20. end
  21.  
  22. -- media is the media handle to access the media from object store
  23. method addDataObject self {class AdDataBase} data #key container:(undefined) ->
  24. (
  25.     if data <> undefined do
  26.     (
  27.         -- Create a new ad data object from the raw data collection.
  28.         local adObj
  29.         adObj := new AdDataObject data:data
  30.         if container <> undefined then
  31.         (
  32.             append self adObj
  33.         )
  34.         else
  35.             append self adObj        
  36.     )
  37. )
  38.  
  39. method addManyDataObjects self {class AdDataBase} data #key container:(undefined)->
  40. (
  41.     for i in data do
  42.         addDataObject self i container:container
  43.     OK
  44. )
  45.  
  46.  
  47. -->>>
  48. "Compiled database.sx"
  49.